package com.prosay.ioc.spring;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ComTest {
    public static void main(String[] args) {
    	
    	// 通过spring的配置文件 来启动上下文
		ApplicationContext context = 
				new ClassPathXmlApplicationContext("/com/prosay/ioc/spring/springConfig.xml");
	    
		//System.out.println("context: " + context);
		Computer computer = (Computer)context.getBean("computer");
		computer.work();
    }
}
